package com.dingwen.treasure.open.api.pub.config;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

/**
 * 微信公众号配置
 *
 * @author dingwen
 * @date 2022/12/28
 */
@Configuration(proxyBeanMethods = false)
@ConfigurationProperties(prefix = "treasure.wechat.pub")
@RefreshScope
@Getter
@Setter
@Slf4j
public class WechatPubConfig {

    /**
     * 授权类型
     */
    private String grantType = "client_credential";

    /**
     * appid
     */
    private String appid = "wx58b3d130e9a1c80d";

    /**
     * secret
     */
    private String secret = "4c20bbae58f2acc25d191d6e7dbca760";

    /**
     * 基础API地址
     */
    private String baseUrl = "https://api.weixin.qq.com";

    /**
     * 获取token请求地址
     */
    private String tokenRrl = baseUrl.concat("/cgi-bin/token");

    /**
     * 获取关注用户列表地址
     */
    private String openIdsUrl = baseUrl.concat("/cgi-bin/user/get");

    /**
     * 推送模版消息地址
     */
    private String pushTemplateMsgUrl = baseUrl.concat("/cgi-bin/message/template/send");

    /**
     * 月： 早安模版
     */
    private String yueMorningTemplateId = "UXd2JVOx56-txQXgyWP__g5WKsj5LTTq47PQeofRzq4";

    /**
     * 月，晚安心语
     */
    private String yueGoodNightTemplateId = "lz9qiSON88svmVsjNfC7h2nixpPh2CLq34ItmmJx24g";

    /**
     * token获取异常允许重试次数
     */
    private Integer retryCount = 5;
}
